<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
    function check(email){
        var index1=email.indexOf("@");
        var index2=email.indexOf(".");
        if(index1>0 && index2-index1>1 && index2<email.length-1){
            result="注册邮箱符合要求！";
        }else{
            result="注册邮箱格式不正确！";
        }
        return result;
    }
    var email="abc@sina.com";
    alert(check(email));
</script>
</body>
</html>
